xen: arm: flush dcache while preparing the device tree for Dom0
authorOleksandr Dmytryshyn <oleksandr.dmytryshyn@globallogic.com>
Wed, 27 Nov 2013 17:09:52 +0000 (19:09 +0200)
committerIan Campbell <ian.campbell@citrix.com>
Fri, 29 Nov 2013 10:29:04 +0000 (10:29 +0000)
Without flushing dcache the hypervisor couldn't copy the device tree
correctly when booting the kernel dom0 Image (memory with device tree
is corrupted). As the result - when we try to load the kernel dom0
Image - dom0 hungs frequently. This issue is not reproduced with the
kernel dom0 zImage because the zImage decompressor code flushes all
dcache before starting the decompressed kernel Image. When the
hypervisor loads the kernel image or initrd, this memory region
isn't corrupted because the hypervisor code flushes the dcache.

Signed-off-by: Oleksandr Dmytryshyn <oleksandr.dmytryshyn@globallogic.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Julien Grall<julien.grall@linaro.org>
xen/arch/arm/domain_build.c

index e9bb01fa2d5da646886fcc972bff679e037d7ecf..99e785aaaab3ba7037affbbd910bfab8778c61b0 100644 (file)
@@ -906,7 +906,8 @@ static void dtb_load(struct kernel_info *kinfo)
     printk("Loading dom0 DTB to 0x%"PRIpaddr"-0x%"PRIpaddr"\n",
            kinfo->dtb_paddr, kinfo->dtb_paddr + fdt_totalsize(kinfo->fdt));
 
-    rc = raw_copy_to_guest(dtb_virt, kinfo->fdt, fdt_totalsize(kinfo->fdt));
+    rc = raw_copy_to_guest_flush_dcache(dtb_virt, kinfo->fdt,
+                                        fdt_totalsize(kinfo->fdt));
     if ( rc != 0 )
         panic("Unable to copy the DTB to dom0 memory (rc = %lu)\n", rc);
     xfree(kinfo->fdt);